/**
*   \file   point.h
*   \author Dave Reid
*   \brief  Header file for the point class.
*/
#ifndef __EAGL_point3_H_
#define __EAGL_point3_H_

#include "../types.h"

namespace eagl
{

/**
*   \brief  Class representing a point in 3D space.
*/
class Point3
{
public:

    /**
    *   \brief  Default constructor.
    */
    Point3() : m_pos(0.0f, 0.0f, 0.0f)
    {
    }

    /**
    *   \brief  Copy constructor.
    */
    Point3(const Point3 &point) : m_pos(point.getPosition())
    {
    }

    /**
    *   \brief           Constructor.
    *   \param  pos [in] The position of the point.
    */
    Point3(const vec3 &pos) : m_pos(pos)
    {
    }

    /**
    *   \brief         Constructor.
    *   \param  x [in] The x position of the point.
    *   \param  y [in] The y position of the point.
    *   \param  z [in] The z position of the point.
    */
    Point3(float x, float y, float z) : m_pos(x, y, z)
    {
    }

    /**
    *   \brief  Retrieves the position of the point.
    *   \return The position of the point.
    */
    const vec3 & getPosition() const
    {
        return this->m_pos;
    }

    /**
    *   \brief  Sets the position of the point.
    *   \param  pos [in] The new position of the point.
    */
    void setPosition(const vec3 &pos)
    {
        this->m_pos = pos;
    }

    /**
    *   \brief         Sets the position of the point.
    *   \param  x [in] The x position of the point.
    *   \param  y [in] The y position of the point.
    *   \param  z [in] The z position of the point.
    */
    void setPosition(float x, float y, float z)
    {
        this->m_pos.x = x;
        this->m_pos.y = y;
        this->m_pos.z = z;
    }


private:

    /// The position of the point.
    vec3 m_pos;
};

}

#endif  // __EAGL_point3_H_